
<%@ page import="com.surelution.projects.crm.GasPlanList" %>
<%@ page import="com.surelution.projects.crm.OwnStation" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'gasPlanList.label', default: 'GasPlanList')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
             <g:form action="list" >
                <div class="dialog3">
                    <table>
                        <tbody>
                        	<tr class="prop">
                                <td valign="top" class="name">
                                    所属油站
                                </td>
                                <td valign="top" class="value">
                                	<g:select name="station.id" from="${OwnStation.list()}" optionKey="id" optionValue="shortName" noSelection='${["":""] }' value="${params['station.id'] }"/>
                                </td>
                            </tr>
                            <tr class="prop">
                                <td valign="top" class="name">
                                  计划年月
                                </td>
                                <td valign="top" class="value">
                                	<g:textField name="dateFrom" value="${params.dateFrom }"/>~
                                	<g:textField name="dateTo" value="${params.dateTo }"/>
                                	<g:submitButton name="search" class="search" value="${message(code: 'default.button.search.label', default: 'Search')}" />
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </g:form>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'gasPlanList.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="station" title="${message(code: 'gasPlanList.station.label', default: 'station')}" />

                            <g:sortableColumn property="planTime" title="${message(code: 'gasPlanList.planTime.label', default: 'planTime')}" />
                        
                            <g:sortableColumn property="fuelAmount" title="${message(code: 'gasPlanList.fuelAmount.label', default: 'Fuel Amount')}" />
                        
                            <g:sortableColumn property="gasolineAmount" title="${message(code: 'gasPlanList.gasolineAmount.label', default: 'Gasoline Amount')}" />
                        
                            <g:sortableColumn property="retailAmount" title="${message(code: 'gasPlanList.retailAmount.label', default: 'retailAmount')}" />
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${gasPlanListInstanceList}" status="i" var="gasPlanListInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${gasPlanListInstance.id}">${fieldValue(bean: gasPlanListInstance, field: "id")}</g:link></td>
                        
                            <td>${OwnStation.findByCode(gasPlanListInstance.stationCode).name}</td>

                            <td>${fieldValue(bean: gasPlanListInstance, field: "planTime")}</td>
                        
                            <td>${fieldValue(bean: gasPlanListInstance, field: "fuelAmount")}</td>
                        
                            <td>${fieldValue(bean: gasPlanListInstance, field: "gasolineAmount")}</td>
                        
                            <td>${fieldValue(bean: gasPlanListInstance, field: "retailAmount")}</td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${gasPlanListInstanceTotal}" params="${params }"/>
            </div>
        </div>
    </body>
</html>
